package jtk.project4.fleet.ibatis.dao;

import java.sql.SQLException;
import java.util.List;

import nl.coderight.jazz.dialog.MessageDialog;
import nl.coderight.jazz.dialog.MessageType;
import jtk.project4.fleet.domain.SecAccessLevels;
import jtk.project4.fleet.domain.Vendor;
import jtk.project4.fleet.domain.VendorType;




public class secaccesslevelsDao extends IbatisDao{
	
	public List selectsecaccesslevels() throws SQLException {
		List selectsecaccesslevels = null;
			selectsecaccesslevels =getSqlMap().queryForList("SELECT_ALL_SECACCESSLEVELS", null);
		return selectsecaccesslevels;
	}


	public int deletesecaccesslevels(SecAccessLevels secaccesslevels) throws SQLException{
		return (int) getSqlMap().delete("DELETE_SECACCESSLEVELS", secaccesslevels);
	}
	
	public int updatesecaccesslevels(SecAccessLevels secaccesslevels) throws SQLException{
		return (int) getSqlMap().update("UPDATE_SECACCESSLEVELS", secaccesslevels);
	}
	
	public SecAccessLevels insertsecaccesslevels(SecAccessLevels secaccesslevels) throws SQLException{
		return (SecAccessLevels) getSqlMap().insert("INSERT_SECACCESSLEVELS", secaccesslevels);
	}

	public SecAccessLevels insertsecaccesslevelsType(SecAccessLevels secaccesslevels) throws SQLException {
		return (SecAccessLevels) getSqlMap().insert("INSERT_SECACCESSLEVELS_TYPE",secaccesslevels);
	}
	
		public List selectVendorType() throws SQLException {
		return getSqlMap().queryForList("SELECT_ALL_VENDOR_TYPE", null);
	}
	
		
	public static void main (String args[]) throws SQLException{
		SecAccessLevels secaccesslevels;
		secaccesslevels = new SecAccessLevels();
		
		
		List<SecAccessLevels> cba;
		secaccesslevels = new SecAccessLevels();
		cba = new secaccesslevelsDao().selectsecaccesslevels();
		System.out.println(cba.size());
		
		secaccesslevels.setAccessId(1);
		secaccesslevels.setName("Test");
		secaccesslevels.setCanDelete("Y");
		new secaccesslevelsDao().insertsecaccesslevels(secaccesslevels);
		
		
		/*secaccesslevels.setAccessId(1);
		secaccesslevels.setName("testupdate");
		new secaccesslevelsDao().updatesecaccesslevels(secaccesslevels);*/
		
		//new secaccesslevelsDao().deletesecaccesslevels(secaccesslevels);
		}
	
}